#include "utf8_to_ascii.h"
#include <windows.h>

namespace utf8_tool
{
	std::string utf8_to_ascii(const char* utf8)
	{
		int len = (int)(strlen(utf8)+1);  
		char* outch = new char[len];
		WCHAR * wChar = new WCHAR[len];  
		wChar[0] = 0;  
		MultiByteToWideChar(CP_UTF8, 0, utf8 , len, wChar, len);  
		WideCharToMultiByte(CP_ACP, 0, wChar, len, outch , len, 0, 0);  
		delete [] wChar;  
		char* pchar = outch;  
		std::string out = pchar;
		delete [] outch;
		return out;
	}

}//namespace utf8_tool end